package com.neusoft.neuiotms.dcom.model.hn;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;
import com.neusoft.neuiotms.dcom.model.enums.HnInspectionTaskItemStatus;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_inspection_health_task_item_value_hn")
@org.hibernate.annotations.Table(appliesTo = "neuiot_inspection_health_task_item_value_hn", comment = "海南定期健康巡检任务巡检内容值表")
public class HnInspectionHealthTaskItemValue extends AbstractModel {

    private static final long serialVersionUID = 304191577085280819L;

    @ManyToOne
    private HnInspectionItem item;

    @Enumerated(EnumType.STRING)
    @Column(length = 16, nullable = false)
    @Comment("varchar(16) NOT NULL COMMENT '巡检项状态'")
    private HnInspectionTaskItemStatus status;

    @Length(max = 255, message = "值不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL COMMENT '值'")
    private String value;

    @Length(max = 255, message = "异常原因不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL COMMENT '异常原因'")
    private String reason;

    @ManyToOne
    private HnInspectionHealthTask task;

}
